package kr.co.xosoft.db;

import kr.co.xosoft.common.Config;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper{
	public DBHelper(Context context) {
		super(context, Config.DB_NAME, null, Config.DB_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String createTableSql = "create table "+Config.TABLE_NAME+"(" +
								" id integer primary key autoincrement, autoflagyn bool not null, waittime integer not null, viewtype integer not null);";
		db.execSQL(createTableSql);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("drop table if exist "+Config.TABLE_NAME);
		onCreate(db);
	}
}
